/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1621998556023_1631';

  // add your middleware config here
  config.middleware = [];

  config.security = {
    csrf: {
      enable: false
    }
  }

  config.cluster = {
    listen: {
      port: 7003
    }
  };

  config.redis = {
    client: {
      port: 6379,
      // host: '127.0.0.1',
      host: '47.91.189.64',
      password: '',
      db: 0,
    },
  };

  config.mongoose = {
    // 多数据库的写法
    clients: {
      NEWS: {
        url: 'mongodb://localhost:27017/huohua',
        // url: 'mongodb://admin:renren-news@localhost:27017/huohua',
        options: {
          useUnifiedTopology: true
        },
      }
    }
  }

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
